<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>My JSP 'list_orderTrace.jsp' starting page</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <link rel="stylesheet" type="text/css" href="<c:url value="/css/application.css"></c:url>">
    <link rel="stylesheet" type="text/css" href="<c:url value="/css/listdata.css"></c:url>">
    <link rel="stylesheet" type="text/css" href="<c:url value="/css/form.css"></c:url>">

   <script type="text/javascript" src="<c:url value="/js/common.js"/>"></script>
   
    <script type="text/javascript">
         
          function doQuery(pageno)
         {
            if(pageno<1 || pageno>${page.totalPageNum})
            {
              alert("页号超出范围，有效范围：[1-${page.totalPageNum}]!");
              ${'pageNo'}.select();
              return;
            }
            
            var f=document.forms[0];
            f.action=f.action+"?pageNo="+pageno;
            f.submit();
            
         }
         
       
    
    </script>
  </head>
  
  <body>
     <div class="listTitle"> 
      >> 订单跟踪查询
    </div>
    <c:if test="${not empty page.pageContent}">
    <form action="<c:url value="/orderMgr"/>" method="post">
    <input type="hidden" name="act" value="showOrderTrace">
     <div>
                     订单号：<input type="text" class="text" name="qryOrderId" size="20" value="${param['qryOrderId']}"/>&nbsp;&nbsp;
                   操作员：<select name="qrymanager" >
	            <option value="0">==请选择==</option>
	            <c:forEach var="manager" items="${managers}">
	               <option value="${manager.loginId}" <c:if test="${param['qrymanager']==manager.loginId}">selected</c:if>>${manager.realName}</option>
	            </c:forEach>
              </select>&nbsp;&nbsp;
       <input style="margin-left: 500px" type="submit" value="查询">
     </div>
     </form>
    <table class="listable" cellspacing=0 cellpadding=0 border=0>
       <thead>
         <tr>
           <th nowrap="nowrap">ID</th>
           <th nowrap="nowrap">订单号</th>
           <th nowrap="nowrap">订单状态</th>
           <th nowrap="nowrap">操作员</th>
           <th nowrap="nowrap">客户</th>
           <th nowrap="nowrap">操作时间</th>
         </tr>          
       </thead>
       <tbody>
       <c:forEach var="orderTrace" items="${page.pageContent}">
          <tr>
	            <td nowrap="nowrap">${orderTrace.id}</td>
	            <td nowrap="nowrap">${orderTrace.orderId}</td>
	            <td nowrap="nowrap">
	            <c:if test="${orderTrace.orderStatus=='A'}">提交订单</c:if>
	            <c:if test="${orderTrace.orderStatus=='B'}">审核,未发货</c:if>
	            <c:if test="${orderTrace.orderStatus=='C'}">已发货</c:if>
	            <c:if test="${orderTrace.orderStatus=='D'}">完成订单</c:if>
	            <c:if test="${orderTrace.orderStatus=='E'}">订单已取消</c:if>
	            <c:if test="${orderTrace.orderStatus=='F'}">已收货</c:if>
	            </td>
	            <td nowrap="nowrap">${orderTrace.manager.realName}&nbsp;</td>
	             <td nowrap="nowrap">
	             ${orderTrace.customer.customerName}&nbsp;
	             </td>
	             <td>
		                <fmt:formatDate value="${orderTrace.operTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
		              </td>
	          </tr>
	          </c:forEach>
       </tbody>
    </table>
       <div id="pageinfo" style="float:right; margin:5px; padding-right:3px;">
		            共${page.totalRecNum}条, 当前显示${page.startIndex+1}-${page.endIndex}条, 第${page.pageNo}/${page.totalPageNum}页
		           |
		           <c:if test="${page.pageNo>1}">
		             <span class="linkspan" onclick="doQuery(1)">首页</span>&nbsp;
		           </c:if>
		           <c:if test="${page.prePage}">
		             <span class="linkspan" onclick="doQuery(${page.pageNo-1})">上一页</span>&nbsp;
		           </c:if>
		           <c:if test="${page.nextPage}">
		             <span class="linkspan" onclick="doQuery(${page.pageNo+1})">下一页</span>&nbsp;
		           </c:if>
		           <c:if test="${page.pageNo!=page.totalPageNum}">
		             <span class="linkspan" onclick="doQuery(${page.totalPageNum})">末页</span>&nbsp;
		           </c:if>
		           |
		            到<input type="text" id="pageNo" size=4 style="text-align:right;" onkeypress="onlynumber();"/> 页
		           <button onclick="doQuery($('pageNo').value);"> 跳 转 </button>		           		           	           	              
		        </div>
	     </div>  
 </c:if>
<c:if test="${empty page.pageContent}">
       <center>
        <div id="noRecord" style="margin-top:80px;width:30%;height:70px;border:1px solid #c1cdd8;text-align:center;">
          <span style="margin-top:20px;color:red;">没有符合条件的订单跟踪信息被找到!</span>
          <br/>
          <br/>
          <button onclick="history.go(-1);"> 返 回 </button>
        </div>
       </center>
</c:if>
     
     <c:if test="${not empty errMsg}">
      <script type="text/javascript">
        alert('${errMsg}');
      </script>
       <c:remove var="errMsg"/>
     </c:if>
  </body>
</html>
